Conversation
…crete-time); new demos in tutorials
…ick likelihood profile to quickstart
|
This looks great to a first read! I'll read in more depth tomorrow. In the mean time, we should write up & update the PR description. This should be squash & merged, so the description should be fairly complete as to sufficiently describe the progress & design choices on its own. |
| """ | ||
| Validate that ctrl_times/ctrl_values align with obs_times if provided. | ||
|
|
||
| Raises: | ||
| ValueError: If control times length doesn't match observation times length. | ||
| """ |
There was a problem hiding this comment.
Explain all the rules that are being tested
|
@mattlevine22 left feedback |
add comment Co-authored-by: Dan Waxman <dan.waxman1@gmail.com>
improve comment Co-authored-by: Dan Waxman <dan.waxman1@gmail.com>
There was a problem hiding this comment.
Updated based on @DanWaxman's feedback.
Summary
This PR introduces first-class support for predict_times-driven simulation and filter rollout across simulators and filtering integrations, with consistent output sites, shape handling, and docs/tests coverage.
- Adds/expands simulator + filter composition so models can:
- condition on
obs_times/obs_values - optionally roll out trajectories at
predict_times - expose deterministic rollout outputs (
f_predicted_times,f_predicted_states,f_predicted_observations) in a consistent way.
- condition on
- Refactors simulator internals (notably
BaseSimulator/DiscreteTimeSimulator/SDE/ODE flow) to better separate:- conditioning paths vs forward simulation paths
- n-simulation vectorized execution vs single-trajectory conditioned execution
- filter-rollout segmentation behavior.
- Unifies particle-filter posterior conversion logic across integrations via shared utility code (
particles_to_delta_mixtures), with standardized expected tensor shapes and cleaner backend plumbing. - Improves control/time validation and alignment behavior (including union-of-times handling where relevant), and clarifies edge-case behavior for missing grids.
- Adds substantial test coverage for matrixed input combinations and shape contracts:
- new input-matrix tests for
obs_times/obs_values/predict_times - predictive shape tests for
num_samplesandn_simulations - updated smoke/science/model tests to reflect new rollout/output conventions.
- new input-matrix tests for
- Updates API docs/tutorials to clearly explain:
- when to use
obs_timesvspredict_times - required pairing of
obs_timesandobs_values - deterministic site names and resulting output shapes.
- when to use
- Updates notebooks with concrete
predict_timesexamples, including:- rollout/forecasting after filtering
- back-fill interpolation/reconstruction between observation times.
Motivation
Before this PR, we did not expose predict_times as a supported workflow.
That meant users could not cleanly ask for trajectories at arbitrary prediction times (for rollout, interpolation/back-fill, or post-filter forecasting) within the standard simulator/filter interface.
This PR adds that capability and makes the behavior explicit, tested, and documented.
|
Great, thanks! There's one or two remaining comments open, then I think it's good to merge!! |
* faster test strategy * simplify num samples * update blackjax mcmc notebook * updating notebooks; didnt re-run GP, but should work * re-ran sde non-gaussian notebook * reran profile mll nb
|
I added to the description. As long as tests pass, this seems okay to me. PerformanceThis solution entails some additional checks + building and storing filtered distributions at all |
Addresses #50 #116
Summary
This PR introduces first-class support for
predict_times-driven simulation and filter rollout across simulators and filtering integrations, with consistent output sites, shape handling, and docs/tests coverage.obs_times/obs_valuespredict_timesf_predicted_times,f_predicted_states,f_predicted_observations) in a consistent way.BaseSimulator/DiscreteTimeSimulator/SDE/ODE flow) to better separate:particles_to_delta_mixtures), with standardized expected tensor shapes and cleaner backend plumbing.obs_times/obs_values/predict_timesnum_samplesandn_simulationsobs_timesvspredict_timesobs_timesandobs_valuespredict_timesexamples, including:Motivation
Previously, prediction-time rollout and simulator/filter interoperability were harder to reason about and less uniformly tested/documented, especially around mixed
obs_times/predict_timesworkflows and shape conventions.This PR makes that behavior explicit, consistent, and verifiable: users can condition and forecast in one coherent interface, while downstream analysis/tests/docs rely on stable site naming and tensor shape contracts.
Performance
This solution entails some additional checks + building and storing filtered distributions at all
obs_timespoints during a sample statement. In our experiments, this causes a ~20% overhead. This is non-negligible, but seems worth it to have the prediction feature.